﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using HHL_Util;

namespace HHL_Acc
{
    public partial class MDI_FRM : Form
    {
        private int childFormNumber = 0;

        public MDI_FRM()
        {
            InitializeComponent();
            //this.TopMost = true;
            //            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            if (flag == 1)
            {
                DangNhapFRM dangNhapFrm = new DangNhapFRM();
                // dangNhapFrm.MdiParent = this;
                dangNhapFrm.ShowDialog();
                flag = 0;
            }
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
            Form childForm = new Form();
            childForm.MdiParent = this;
            childForm.Text = "Window " + childFormNumber++;
            childForm.Show();
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
            }
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
            }
        }

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //toolStrip.Visible = toolBarToolStripMenuItem.Checked;
        }

        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            statusStrip.Visible = mExportTicketAcc.Checked;
        }

        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            PhieuNhapKhoFRM phieuNhapKhoFrm = new PhieuNhapKhoFRM();
            phieuNhapKhoFrm.MdiParent = this;
            phieuNhapKhoFrm.Show();
        }

        private void MDI_FRM_Load(object sender, EventArgs e)
        {
        }

        private int flag = 1;

        private void banVeThangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BanVeThangFRM frmVethang = new BanVeThangFRM();
            frmVethang.MdiParent = this;
            frmVethang.Show();
        }

        private void mLogin_File_Click(object sender, EventArgs e)
        {
            if (flag == 1)
            {
                DangNhapFRM dangNhapFrm = new DangNhapFRM();
                // dangNhapFrm.MdiParent = this;
                dangNhapFrm.ShowDialog();
                flag = 0;
            }
        }

        private void mChangeConfig_File_Click(object sender, EventArgs e)
        {
        }

        private void mExport_TicketAccount_Click(object sender, EventArgs e)
        {
            PhieuXuatKho frmphieuxuatkho = new PhieuXuatKho();
            frmphieuxuatkho.MdiParent = this;
            frmphieuxuatkho.Show();
        }
    }
}